@extends('admin._layout')

@section('breadcrumb')
    <li>
        <i class="icon-home home-icon"></i>
        <a href="#">首页</a>
    </li>
    <li class="active">贷款产品列表</li>
@stop

@section('page-header')
    <h1>
        贷款产品列表
        <small>
            <i class="icon-double-angle-right"></i>
            查看
        </small>
    </h1>
@stop

@section('page-content')
    <div class="col-xs-12">
        <div class="col-xs-12">
            <div class="pull-right mar-b-10">
                <a href="javascript:;" class="btn btn-sm btn-info multi_search_btn"><i class="icon-search bigger-120"></i>搜索</a>
                <a href="/admin/loan/add" class="btn btn-sm btn-success"><i class="icon-edit bigger-120"></i>添加</a>
            </div>
        </div>
        <div class="col-xs-12" id="multi_search" style="display: none">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="col-lg-12">
                        <form class="form-horizontal">
                            <input type="hidden" name="sortBy" value="">
                            <input type="hidden" name="sort" value="">
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">ID</label>
                                    <div class="col-lg-4">
                                        <input type="text" class="form-control" name="id" value="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">用户名</label>
                                    <div class="col-lg-4">
                                        <input type="text" class="form-control" name="nickname" value=" ">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">手机号码</label>
                                    <div class="col-lg-4">
                                        <input type="text" class="form-control" name="mobile" value="">
                                    </div>
                                </div>
                                <div class="form-group-lg">
                                    <div class="col-lg-offset-2 col-lg-4">
                                        <button type="submit" class="btn btn-primary">开始搜索</button>
                                        <a href="javascript:flush_condition();" class="btn btn-primary">清空条件</a>
                                        <a href="javascript:;" class="multi_search_btn">收起</a>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content">
                    <div class="table-responsive">
                        <table id="sample-table-1" class="table table-hover">
                            <thead>
                            <tr>
                                <th class="center">ID</th>
                                <th class="center">图标</th>
                                <th class="center">产品名</th>
                                <th class="center">利率</th>
                                <th class="center">设置</th>
                            </tr>
                            </thead>

                            <tbody>
                            @foreach ($loans as $loan)
                                <tr>
                                    <td class="center">{{$loan->id}} </td>
                                    <td class="center">
                                        <div class='image-gallery-button'>
                                            @if(!empty($loan->icon))
                                                <a href="/{{$loan->icon}}"><img class="avatar" src="/{{$loan->icon}}" style="width: 40px;"></a>
                                            @endif
                                        </div>
                                    </td>
                                    <td>{{$loan->name}}</td>
                                    <td class="center"> {{$loan->rate}}</td>
                                    <td class="center"><a href="/admin/loan/{{$loan->id}}">编辑</a>   <a href="/admin/loan/delete/{{$loan->id}}">下架</a></td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <div class="pull-right">

                        </div>
                    </div><!-- /.table-responsive -->
                </div>
            </div>
        </div><!-- /.table-responsive -->
    </div><!-- /span -->
    <!-- 图片容器 -->

@stop
@section('scripts')
    <script>
//        $('.multi_search_btn').click(function(){
//            $('#multi_search').slideToggle();
//        });
//
//        function flush_condition()
//        {
//            $("input[name='id']").val('');
//            $("input[name='name']").val('');
//            $("input[name='mobile']").val('');
////            $("input[name='face_score_update']").attr("checked",false);
//        }
//
//        //图片画廊
//        $('.image-gallery-button').on('click', function (event) {
//            $("[data-gallery]").removeAttr('data-gallery');
//            $(this).find('a').attr('data-gallery', '');
//            blueimp.Gallery('',$('.blueimp-gallery').data())
//        });
    </script>
@stop